var webpackMerge = require('webpack-merge');
var commonConfig = require('./webpack.common.js');
var utils = require('./utils');
const ENV = process.env.ENV = process.env.NODE_ENV = 'development';


module.exports = webpackMerge.smart(commonConfig({ env: 'production' }), {
    devtool: 'cheap-module-source-map', //for  debug ts file
    entry: entries(),
    output: {
        path: utils.root('pub'),
        publicPath: '', // relative path  <>
        filename: '[name].bundle.js',
        chunkFilename: '[id].chunk.bundle.js'
    }

   
});

function entries(globPath) {
    var entries = {};
    utils.getEntries(utils.root('src', 'component'), entries);
    return entries;
}